package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;
import java.util.List;

public class SignalServiceEndpoint implements Sequenceable, Serializable {

    @SerializedName("signal")
    private String signal;

    @SerializedName("actions")
    private List<ActionsItem> actions;


    public static final Sequenceable.Producer<SignalServiceEndpoint> CREATOR = new Producer<SignalServiceEndpoint>() {
        @Override
        public SignalServiceEndpoint createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            SignalServiceEndpoint signalServiceEndpoint = new SignalServiceEndpoint();
            signalServiceEndpoint.unmarshalling(parcel);
            return signalServiceEndpoint;
        }
    };
    
    
    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeString(this.signal);
        parcel.writeList(this.actions);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        this.signal=parcel.readString();
        this.actions = parcel.readSequenceableList(ActionsItem.class);
        return true;
    }

    @Override
    public String toString() {
        return "SignalServiceEndpoint{" +
                "signal='" + signal + '\'' +
                ", actions=" + actions +
                '}';
    }

    public String getSignal() {
        return signal;
    }

    public void setSignal(String signal) {
        this.signal = signal;
    }

    public List<ActionsItem> getActions() {
        return actions;
    }

    public void setActions(List<ActionsItem> actions) {
        this.actions = actions;
    }
}
